<template>
  <el-input v-model="RegisterRequest.phone" style="width: 240px" placeholder="电话" />
  <el-input v-model="RegisterRequest.email" style="width: 240px" placeholder="邮箱" />
  <el-input v-model="RegisterRequest.password" style="width: 240px" placeholder="密码" />
  <el-button type="primary" @click="doReg">注册</el-button>
</template>

<script lang="ts" setup>
  import {reactive} from "vue";
  import axios from "axios";

  const RegisterRequest = reactive({
    regType: '',
    phone:'',
    email:'',
    password:''
  })

  const doReg = () => {
    axios
        .post('http://localhost:8080/register',RegisterRequest)
        .then(response => (console.log(response)))
        .catch(function (error) { // 请求失败处理
          console.log(error);
        });
  };
</script>

<style scoped>

</style>